package com.ems.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Date;
import java.text.SimpleDateFormat;

@AllArgsConstructor
@Getter
public enum ResultCode {
    SUCCESS(true, 2000, "成功"),
    ERROR(false, 2001, "未知错误 "+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())),
    PARAM_ERROR(false, 2002, "参数错误 "+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())),
    NULLPOINTER(false, 2003, "空指向异常 "+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())),
    NULLUSERNAME(false,2005,"用户名不存在"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())),
    ERROR_PWD(false,2006,"密码错误"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())),
    HAS_FINISH(false,2007,"已经完成所有批阅"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())),
    NULLEXAM(false,2008,"没有与你相关的考试"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())),
    HASPUTANSWER(false,2009," 已经提交过"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));

    // 是否成功
    private Boolean success;
    // 响应编码
    private Integer code;
    // 响应消息
    private String message;
}
